package com.yhp.service.impl;

import com.yhp.bean.Users;
import com.yhp.dao.UsersDao;
import com.yhp.dao.impl.UsersDaoImpl;
import com.yhp.service.UsersService;

import java.util.List;

public class UsersServiceImpl implements UsersService {

    @Override
    public int insert(Users users) {
        return usersDao.insert(users);
    }

    @Override
    public boolean checkuser(String uname) {
        return usersDao.checkuser(uname);
    }

    @Override
    public int updateuser(Users users) {
        return usersDao.updateuser(users);
    }

    @Override
    public Users selectByid(int userid) {
        return usersDao.selectByid(userid);
    }

    @Override
    public int deleteUser(int userid) {
        return usersDao.deleteUser(userid);
    }

    @Override
    public int deleteById(int userid) {
        return usersDao.deleteById(userid);
    }

    UsersDao usersDao=new UsersDaoImpl();
    @Override
    public Users login(String username, String pass) {
        return usersDao.login(username, pass);
    }

    @Override
    public List<Users> selectAll(int pageIndex,int size,String uname,String usex) {
        return usersDao.selectAll(pageIndex, size,uname,usex);
    }

    @Override
    public int totalCount(String uname,String usex) {
        return usersDao.totalCount(uname,usex);
    }

}
